/*
 * @(#)MaintDmsDefaultProfileSettingForm.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.dms.web;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

import com.dcivision.dms.bean.DmsDefaultProfileSetting;
import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.bean.AbstractBaseObject;
import com.dcivision.framework.web.AbstractActionForm;

/**
  MaintDmsDefaultProfileSettingForm.java

  This class is the for web form purpose.

  @author      Rollo Chan
  @company     DCIVision Limited
  @creation date   02/01/2004
  @version     $Revision: 1.9.4.1 $
*/
 
public class MaintDmsDefaultProfileSettingForm extends AbstractActionForm {

  public static final String REVISION = "$Revision: 1.9.4.1 $";

  private String fieldName = null;
  private String fieldLabel = null;
  private String fieldType = null;
  private String mandatoryFlag = null;
  
  private String valueSuggestFlag = null;
  
  private String reference = null;
  private String sqlStat = null;
  
  // default value
  private String defaultValue = null;
  private String useSystemDate = null;
  private String defaultSelectValues = null;

  
  //Display options in Listing page
  private String[] basicSelectedID = null;
  private String[] basicSelected = null;
  private String selectedOrder = null;
  
  private String number=null;
  
  public MaintDmsDefaultProfileSettingForm() {
    super();
  }

  public String getFieldName() { 
    return(this.fieldName);
  }

  public void setFieldName(String fieldName) { 
    this.fieldName = fieldName;
  }

  public String getFieldLabel() { 
    return(this.fieldLabel);
  }

  public void setFieldLabel(String fieldLabel) { 
    this.fieldLabel = fieldLabel;
  }

  public String getFieldType() { 
    return(this.fieldType);
  }

  public void setFieldType(String fieldType) { 
    this.fieldType = fieldType;
  }

  public String getMandatoryFlag() { 
    return(this.mandatoryFlag);
  }

  public void setMandatoryFlag(String mandatoryFlag) { 
    this.mandatoryFlag = mandatoryFlag;
  }

  public String getReference() { 
    return(this.reference);
  }

  public void setReference(String reference) { 
    this.reference = reference;
  }


  public String[] getBasicSelectedID() {
    return(this.basicSelectedID);
  }

  public void setBasicSelectedID(String[] basicSelectedID) {
    this.basicSelectedID = basicSelectedID;
  }
  
  public String getSqlStat() { 
    return(this.sqlStat);
  }

  public void setSqlStat(String sqlStat) { 
    this.sqlStat = sqlStat;
  }
  
  public String getDefaultValue(){
    return this.defaultValue;
  }
  
  public void setDefaultValue(String defaultValue){
    this.defaultValue = defaultValue;
  }
  
  public String getUseSystemDate(){
    return this.useSystemDate;
  }
  
  public void setUseSystemDate(String useSystemDate){
    this.useSystemDate = useSystemDate;
  }
  
  public String getDefaultSelectValues(){
    return defaultSelectValues;
  }  
  
  public String getNumber(){
    return this.number;
  }
  
  public void setNumber(String number){
    this.number = number;
  } 
  
  public String[] getBasicSelected() {
    return(this.basicSelected);
  }

  public void setBasicSelected(String[] basicSelected) {
    this.basicSelected = basicSelected;
  }
  
  public String getSelectedOrder(){
    return this.selectedOrder;
  }
  
  public void setSelectedOrder(String selectedOrder){
    this.selectedOrder = selectedOrder;
  }  
  
  public void setDefaultSelectValues(String defaultSelectValues){
    this.defaultSelectValues = defaultSelectValues;
  }

    
  public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    return super.validate(mapping, request);
  }

  public void reset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);
    this.setID(null);
    this.setFieldName(null);
    this.setFieldLabel(null);
    this.setFieldType(null);
    this.setMandatoryFlag(null);
    
    this.setValueSuggestFlag(null);
    
    this.setReference(null);
    this.setSqlStat(null);
    this.setDefaultValue(null);
    this.setUseSystemDate(null);
    this.setDefaultSelectValues(null);
    this.setRecordStatus(null);
    this.setUpdateCount(null);
    this.setCreatorID(null);
    this.setCreateDate(null);
    this.setUpdaterID(null);
    this.setUpdateDate(null);
  }

  public AbstractBaseObject getFormData() throws ApplicationException {
    DmsDefaultProfileSetting tmpDmsDefaultProfileSetting = new DmsDefaultProfileSetting();
    tmpDmsDefaultProfileSetting.setID(TextUtility.parseIntegerObj(this.getID()));
    TextUtility.stringValidation(this.getFieldName());
    tmpDmsDefaultProfileSetting.setFieldName(this.getFieldName());
    TextUtility.stringValidation(this.getFieldLabel());
    tmpDmsDefaultProfileSetting.setFieldLabel(this.getFieldLabel());
    tmpDmsDefaultProfileSetting.setFieldType(this.getFieldType());
    tmpDmsDefaultProfileSetting.setMandatoryFlag(this.getMandatoryFlag());
    
    tmpDmsDefaultProfileSetting.setValueSuggestFlag(this.getValueSuggestFlag());
    
    tmpDmsDefaultProfileSetting.setReference(this.getReference());
    tmpDmsDefaultProfileSetting.setSqlStat(this.getSqlStat());
    tmpDmsDefaultProfileSetting.setDefaultValue(this.getDefaultValue());
    tmpDmsDefaultProfileSetting.setUseSystemDate(this.getUseSystemDate());
    tmpDmsDefaultProfileSetting.setDefaultSelectValues(this.getDefaultSelectValues()); 
    tmpDmsDefaultProfileSetting.setRecordStatus(this.getRecordStatus());
    tmpDmsDefaultProfileSetting.setUpdateCount(TextUtility.parseIntegerObj(this.getUpdateCount()));
    tmpDmsDefaultProfileSetting.setCreatorID(TextUtility.parseIntegerObj(this.getCreatorID()));
    tmpDmsDefaultProfileSetting.setCreateDate(parseTimestamp(this.getCreateDate()));
    tmpDmsDefaultProfileSetting.setUpdaterID(TextUtility.parseIntegerObj(this.getUpdaterID()));
    tmpDmsDefaultProfileSetting.setUpdateDate(parseTimestamp(this.getUpdateDate()));
    return tmpDmsDefaultProfileSetting;
  }

  public void setFormData(AbstractBaseObject baseObj) throws ApplicationException {
    DmsDefaultProfileSetting tmpDmsDefaultProfileSetting = (DmsDefaultProfileSetting)baseObj;
    this.setID(TextUtility.formatIntegerObj(tmpDmsDefaultProfileSetting.getID()));
    this.setFieldName(tmpDmsDefaultProfileSetting.getFieldName());
    this.setFieldLabel(tmpDmsDefaultProfileSetting.getFieldLabel());
    this.setFieldType(tmpDmsDefaultProfileSetting.getFieldType());
    this.setMandatoryFlag(tmpDmsDefaultProfileSetting.getMandatoryFlag());
    
    this.setValueSuggestFlag(tmpDmsDefaultProfileSetting.getValueSuggestFlag());
    
    this.setReference(tmpDmsDefaultProfileSetting.getReference());
    this.setSqlStat(tmpDmsDefaultProfileSetting.getSqlStat());
    this.setDefaultValue(tmpDmsDefaultProfileSetting.getDefaultValue());
    this.setUseSystemDate(tmpDmsDefaultProfileSetting.getUseSystemDate());
    this.setDefaultSelectValues(tmpDmsDefaultProfileSetting.getDefaultSelectValues());
    this.setRecordStatus(tmpDmsDefaultProfileSetting.getRecordStatus());
    this.setUpdateCount(TextUtility.formatIntegerObj(tmpDmsDefaultProfileSetting.getUpdateCount()));
    this.setCreatorID(TextUtility.formatIntegerObj(tmpDmsDefaultProfileSetting.getCreatorID()));
    this.setCreateDate(formatTimestamp(tmpDmsDefaultProfileSetting.getCreateDate()));
    this.setUpdaterID(TextUtility.formatIntegerObj(tmpDmsDefaultProfileSetting.getUpdaterID()));
    this.setUpdateDate(formatTimestamp(tmpDmsDefaultProfileSetting.getUpdateDate()));
  }

	public String getValueSuggestFlag() {
		return valueSuggestFlag;
	}

	public void setValueSuggestFlag(String valueSuggestFlag) {
		this.valueSuggestFlag = valueSuggestFlag;
	}
}
